import urllib.request
import os

def download_mnist():
    base_url = 'http://yann.lecun.com/exdb/mnist/'
    files = [
        'train-images-idx3-ubyte.gz',
        'train-labels-idx1-ubyte.gz',
        't10k-images-idx3-ubyte.gz',
        't10k-labels-idx1-ubyte.gz'
    ]
    
    for file in files:
        print(f'Downloading {file}...')
        urllib.request.urlretrieve(base_url + file, file)
        print(f'Downloaded {file}')

if __name__ == '__main__':
    download_mnist()
